<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/back/css/button.css">
<title>Insert title here</title>
<style type="text/css">
table {
	border-collapse: collapse;
	text-align: center;

	margin-left: -71px;
}

body {
	margin-top: 50px;
	margin-left: 180px;
}
</style>
<script
	src="${pageContext.request.contextPath}/back/jquery/jquery-1.8.3.js"
	type="text/javascript"></script>
<script>
	$(function() {
		$("tr:even").css("background-Color", "lightblue");

	})
</script>
</head>
<body>
	<form action="${pageContext.request.contextPath }/OrderTableServlet"
		method="post"
		style="margin-left: 300px;margin-top: -14px;margin-bottom: 4px;">
		<b>搜索：</b><input type="text" name="name"
			style="width: 331px; height: 35px; font-size: 14px;"
			placeholder="请输入您要查询的姓名"> <input type="submit" value="Go" class="button blue">
	</form>
	<table border="1px">
		<tr>
			<th style="width: 80px;">订单ID</th>
			<th style="width: 60px;">姓名</th>
			<th style="width: 150px;">昵称</th>
			<th style="width: 60px;">身份证号</th>
			<th style="width: 80px;">起点</th>
			<th style="width: 80px;">终点</th>
			<th style="width: 100px;">列车昵称</th>
			<th style="width: 60px;">发车时间</th>
			<th style="width: 60px;">到站时间</th>
			<th style="width: 250px;">发车日期</th>
			<th style="width: 100px;">座位类型</th>
			<th style="width: 50px;">票价</th>
			<th style="width: 100px;">订单状态</th>
		</tr>
		<c:if test="${not empty list1}">
			<c:forEach items="${list1}" var="o">
				<tr>
					<td>${o.oid}</td>
					<td>${o.name}</td>
					<td>${o.uname}</td>
					<td>${o.idcard}</td>
					<td>${o.action}</td>
					<td>${o.over}</td>
					<td>${o.cname}</td>
					<td>${o.starttime}</td>
					<td>${o.endtime}</td>
					<td>${o.actiondate}</td>
					<td>${o.zuotype}</td>
					<td>${o.price}</td>
					<c:if test="${o.state==0 }">
						<td>未支付</td>
					</c:if>
					<c:if test="${o.state==1 }">
						<td>已支付</td>
					</c:if>
					<c:if test="${o.state==2 }">
						<td>已完成</td>
					</c:if>
					<c:if test="${o.state==3 }">
						<td>退票</td>
					</c:if>
				</tr>
			</c:forEach>
		</c:if>
		<c:if test="${not empty list}">
			<c:forEach items="${list}" var="o">
				<tr>
					<td>${o.oid}</td>
					<td>${o.name}</td>
					<td>${o.uname}</td>
					<td>${o.idcard}</td>
					<td>${o.action}</td>
					<td>${o.over}</td>
					<td>${o.cname}</td>
					<td>${o.starttime}</td>
					<td>${o.endtime}</td>
					<td>${o.actiondate}</td>
					<td>${o.zuotype}</td>
					<td>${o.price}</td>
					<c:if test="${o.state==0 }">
						<td>未支付</td>
					</c:if>
					<c:if test="${o.state==1 }">
						<td>已支付</td>
					</c:if>
					<c:if test="${o.state==2 }">
						<td>已完成</td>
					</c:if>
					<c:if test="${o.state==3 }">
						<td>退票</td>
					</c:if>
				</tr>
			</c:forEach>
		</c:if>
		<c:if test="${not empty list1}">
			<tr>
				<td colspan="13" style="text-align: center;"><a
					href="OrderTableServlet?pageIndex=1">首页</a> <a
					href="OrderTableServlet?pageIndex=${pageIndex-1}">上一页</a> <a
					href="OrderTableServlet?pageIndex=${pageIndex+1}">下一页</a> <a
					href="OrderTableServlet?pageIndex=${totalPage }">尾页</a> <span>第${requestScope.pageIndex }页--共${requestScope.totalPage }页</span>
				</td>
			</tr>
		</c:if>

	</table>
</body>
</html>